xm: Improve xm error if booted native
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 4 Feb 2009 11:58:25 +0000 (11:58 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 4 Feb 2009 11:58:25 +0000 (11:58 +0000)
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
tools/python/xen/xm/main.py

index fb98402f26ae2579a64a4997769df537a81307d7..9c19362715c2a32b83838285b14ad4c80b78a88a 100644 (file)
@@ -59,7 +59,11 @@ from xen.util.acmpolicy import ACM_LABEL_UNLABELED_DISPLAY
 import XenAPI
 
 import xen.lowlevel.xc
-xc = xen.lowlevel.xc.xc()
+try:
+    xc = xen.lowlevel.xc.xc()
+except Exception, ex:
+    print >>sys.stderr, ("Is xen kernel running?")
+    sys.exit(1)
 
 import inspect
 from xen.xend import XendOptions